<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" href="/assets/amazeui/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/assets/amazeui/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="/assets/ztree/css/metroStyle/metroStyle.css"/>
    <link rel="stylesheet" href="/assets/iziModal/css/iziModal.css"/>
</head>
<body>

<table width="100%" class="am-table am-table-striped am-table-bordered
            am-table-compact am-text-nowrap am-table-hover" id="table">
    <thead>
    <tr class="am-text-center">
        <td>编号</td>
        <td>设备ID</td>
        <td>地理位置</td>
        <td>报警时间</td>
        <td>维修时间</td>
        <td>维修人员</td>
        <td>设备状态</td>
    </tr>
    </thead>
    <tbody class="am-text-center"></tbody>
</table>

<script src="/assets/iziModal/js/jquery-2.2.4.js"></script>
<script src="/assets/iziModal/js/iziModal.js"></script>
<script src="/assets/amazeui/js/amazeui.js"></script>
<script src="/assets/amazeui/js/amazeui.datatables.min.js"></script>
<script src="/assets/ztree/js/jquery.ztree.all.js"></script>
<script>
    var table;
    $(function(){
        loadTable();
    });

    function loadTable(){
        table = $("#table").DataTable({
            ordering: false,
            bLengthChange: false,
            ordering: false,
            bSort: false,
            serverSide: true,
            searching: false,
            iDisplayLength: 10,
            ajax: {
                url: "/assets/json/repair.json",
                data: function (d) {
                    var key = $("#i_search").val();
                    if(key){
                        d.key = key;
                    }
                }
            },
            columns: [
                {data: "repairId"},
                {data: "deviceId"},
                {data: "parts"},
                {data: "location"},
                {data: "repairTime"},
                {data: "repairPerson"},
                {data: "state"}
//                {data: "installPersion"},
//                {data: "installTime"},
//                {data: "location"},
//                {
//                    data: 'op',
//                    render: function (data,type,row,meta){
//                        var btn;
//
//                        btn = "<div>" +
//                                "<button class='am-btn-xs am-btn am-radius am-btn-secondary'>修改</button> " +
//                                "<button class='am-btn-xs am-btn am-radius am-btn-secondary'>重启</button> " +
//                                "<button class='am-btn-xs am-btn am-radius am-btn-warning'>删除</button> " +
//                                "</div>";
//                        return btn;
//                    }
//                }
            ]
        });
    }
</script>
</body>
</html>